/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.dao.db;

import java.io.Serializable;
import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.jili.ubert.code.CodeTool;
import java.io.IOException;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dragon
 */
@Entity
@Table(name = "trade_executeorder")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "OrderExecuteProgress.findAll", query = "SELECT o FROM OrderExecuteProgress o"),
    @NamedQuery(name = "OrderExecuteProgress.findByOrderID", query = "SELECT o FROM OrderExecuteProgress o WHERE o.orderID = :orderID"),
    @NamedQuery(name = "OrderExecuteProgress.findByAccountCode", query = "SELECT o FROM OrderExecuteProgress o WHERE o.accountCode = :accountCode"),
    @NamedQuery(name = "OrderExecuteProgress.findByDealerUserID", query = "SELECT o FROM OrderExecuteProgress o WHERE o.dealerUserID = :dealerUserID"),
    @NamedQuery(name = "OrderExecuteProgress.findBySubmitTime", query = "SELECT o FROM OrderExecuteProgress o WHERE o.submitTime = :submitTime"),
    @NamedQuery(name = "OrderExecuteProgress.findByTradeDate", query = "SELECT o FROM OrderExecuteProgress o WHERE o.tradeDate = :tradeDate"),
    @NamedQuery(name = "OrderExecuteProgress.findByDateTime", query = "SELECT o FROM OrderExecuteProgress o WHERE o.dateTime = :dateTime"),
    @NamedQuery(name = "OrderExecuteProgress.findByMac", query = "SELECT o FROM OrderExecuteProgress o WHERE o.mac = :mac"),
    @NamedQuery(name = "OrderExecuteProgress.findByIp4", query = "SELECT o FROM OrderExecuteProgress o WHERE o.ip4 = :ip4"),
    @NamedQuery(name = "OrderExecuteProgress.findByOrderTypeEmit", query = "SELECT o FROM OrderExecuteProgress o WHERE o.orderTypeEmit = :orderTypeEmit"),
    @NamedQuery(name = "OrderExecuteProgress.findByTradeOperate", query = "SELECT o FROM OrderExecuteProgress o WHERE o.tradeOperate = :tradeOperate"),
    @NamedQuery(name = "OrderExecuteProgress.findByMarketCode", query = "SELECT o FROM OrderExecuteProgress o WHERE o.marketCode = :marketCode"),
    @NamedQuery(name = "OrderExecuteProgress.findByClassCode", query = "SELECT o FROM OrderExecuteProgress o WHERE o.classCode = :classCode"),
    @NamedQuery(name = "OrderExecuteProgress.findByObj", query = "SELECT o FROM OrderExecuteProgress o WHERE o.obj = :obj"),
    @NamedQuery(name = "OrderExecuteProgress.findByBs", query = "SELECT o FROM OrderExecuteProgress o WHERE o.bs = :bs"),
    @NamedQuery(name = "OrderExecuteProgress.findByOpenClose", query = "SELECT o FROM OrderExecuteProgress o WHERE o.openClose = :openClose"),
    @NamedQuery(name = "OrderExecuteProgress.findByHedgeFlag", query = "SELECT o FROM OrderExecuteProgress o WHERE o.hedgeFlag = :hedgeFlag"),
    @NamedQuery(name = "OrderExecuteProgress.findByPosID", query = "SELECT o FROM OrderExecuteProgress o WHERE o.posID = :posID"),
    @NamedQuery(name = "OrderExecuteProgress.findByCustomCode", query = "SELECT o FROM OrderExecuteProgress o WHERE o.customCode = :customCode"),
    @NamedQuery(name = "OrderExecuteProgress.findByCloseType", query = "SELECT o FROM OrderExecuteProgress o WHERE o.closeType = :closeType"),
    @NamedQuery(name = "OrderExecuteProgress.findByBasketID", query = "SELECT o FROM OrderExecuteProgress o WHERE o.basketID = :basketID"),
    @NamedQuery(name = "OrderExecuteProgress.findByBasketTatol", query = "SELECT o FROM OrderExecuteProgress o WHERE o.basketTatol = :basketTatol"),
    @NamedQuery(name = "OrderExecuteProgress.findBySeqNum", query = "SELECT o FROM OrderExecuteProgress o WHERE o.seqNum = :seqNum"),
    @NamedQuery(name = "OrderExecuteProgress.findByExeTime", query = "SELECT o FROM OrderExecuteProgress o WHERE o.exeTime = :exeTime"),
    @NamedQuery(name = "OrderExecuteProgress.findByExeSequenceNo", query = "SELECT o FROM OrderExecuteProgress o WHERE o.exeSequenceNo = :exeSequenceNo"),
    @NamedQuery(name = "OrderExecuteProgress.findByOutsideExeNo", query = "SELECT o FROM OrderExecuteProgress o WHERE o.outsideExeNo = :outsideExeNo"),
    @NamedQuery(name = "OrderExecuteProgress.findByExeQty", query = "SELECT o FROM OrderExecuteProgress o WHERE o.exeQty = :exeQty"),
    @NamedQuery(name = "OrderExecuteProgress.findByExePrice", query = "SELECT o FROM OrderExecuteProgress o WHERE o.exePrice = :exePrice"),
    @NamedQuery(name = "OrderExecuteProgress.findByCurrency", query = "SELECT o FROM OrderExecuteProgress o WHERE o.currency = :currency"),
    @NamedQuery(name = "OrderExecuteProgress.findByExeAmount", query = "SELECT o FROM OrderExecuteProgress o WHERE o.exeAmount = :exeAmount"),
    @NamedQuery(name = "OrderExecuteProgress.findByCancelQty", query = "SELECT o FROM OrderExecuteProgress o WHERE o.cancelQty = :cancelQty"),
    @NamedQuery(name = "OrderExecuteProgress.findByOrderQty", query = "SELECT o FROM OrderExecuteProgress o WHERE o.orderQty = :orderQty"),
    @NamedQuery(name = "OrderExecuteProgress.findByWorkingQty", query = "SELECT o FROM OrderExecuteProgress o WHERE o.workingQty = :workingQty"),
    @NamedQuery(name = "OrderExecuteProgress.findByCompleteQty", query = "SELECT o FROM OrderExecuteProgress o WHERE o.completeQty = :completeQty"),
    @NamedQuery(name = "OrderExecuteProgress.findByOrderStatus", query = "SELECT o FROM OrderExecuteProgress o WHERE o.orderStatus = :orderStatus"),
    @NamedQuery(name = "OrderExecuteProgress.findByTotalFare", query = "SELECT o FROM OrderExecuteProgress o WHERE o.totalFare = :totalFare"),
    @NamedQuery(name = "OrderExecuteProgress.findByCommissionFare", query = "SELECT o FROM OrderExecuteProgress o WHERE o.commissionFare = :commissionFare"),
    @NamedQuery(name = "OrderExecuteProgress.findByDeliverFare", query = "SELECT o FROM OrderExecuteProgress o WHERE o.deliverFare = :deliverFare"),
    @NamedQuery(name = "OrderExecuteProgress.findByTax", query = "SELECT o FROM OrderExecuteProgress o WHERE o.tax = :tax"),
    @NamedQuery(name = "OrderExecuteProgress.findByOtherCost", query = "SELECT o FROM OrderExecuteProgress o WHERE o.otherCost = :otherCost"),
    @NamedQuery(name = "OrderExecuteProgress.findByEsCheckinAmount", query = "SELECT o FROM OrderExecuteProgress o WHERE o.esCheckinAmount = :esCheckinAmount"),
    @NamedQuery(name = "OrderExecuteProgress.findByReMark", query = "SELECT o FROM OrderExecuteProgress o WHERE o.reMark = :reMark"),
    @NamedQuery(name = "OrderExecuteProgress.findByInvestID", query = "SELECT o FROM OrderExecuteProgress o WHERE o.investID = :investID"),
    @NamedQuery(name = "OrderExecuteProgress.findByOwnUserID", query = "SELECT o FROM OrderExecuteProgress o WHERE o.ownUserID = :ownUserID"),
    @NamedQuery(name = "OrderExecuteProgress.findByAlterUserID", query = "SELECT o FROM OrderExecuteProgress o WHERE o.alterUserID = :alterUserID"),
    @NamedQuery(name = "OrderExecuteProgress.findByCreateTime", query = "SELECT o FROM OrderExecuteProgress o WHERE o.createTime = :createTime"),
    @NamedQuery(name = "OrderExecuteProgress.findByTimeStamp", query = "SELECT o FROM OrderExecuteProgress o WHERE o.timeStamp = :timeStamp")})
public class OrderExecuteProgress implements Serializable {
	public static byte[] EnCode(OrderExecuteProgress msg) throws IOException {
		Codec<OrderExecuteProgress> Lcode = ProtobufProxy.create(OrderExecuteProgress.class);
		return Lcode.encode(msg);
	}
	public static OrderExecuteProgress DeCode(byte[] data) throws IOException {
	Codec<OrderExecuteProgress> Lcode = ProtobufProxy.create(OrderExecuteProgress.class);
		return Lcode.decode(data);
	}

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "OrderID")
    @Protobuf
	private Integer orderID;
    @Basic(optional = false)
    @Column(name = "AccountCode")
    @Protobuf
	private String accountCode;
    @Basic(optional = false)
    @Column(name = "DealerUserID")
    @Protobuf
	private String dealerUserID;
    @Basic(optional = false)
    @Column(name = "SubmitTime")
    @Temporal(TemporalType.TIME)
    private Date submitTime;
    //@Transient
	@Protobuf
	private long submitTimeL;
    @Basic(optional = false)
    @Column(name = "TradeDate")
    @Temporal(TemporalType.DATE)
    private Date tradeDate;
    
	@Protobuf
	private long tradeDateL;
    @Basic(optional = false)
    @Column(name = "DateTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateTime;
    //@Transient
	@Protobuf
	private long dateTimeL;
    @Column(name = "Mac")
    @Protobuf
	private String mac;
    @Column(name = "IP4")
    @Protobuf
	private Integer ip4;
    @Basic(optional = false)
    @Column(name = "OrderTypeEmit")
    @Protobuf
	private String orderTypeEmit;
    @Basic(optional = false)
    @Column(name = "TradeOperate")
    @Protobuf
	private int tradeOperate;
    @Column(name = "MarketCode")
    @Protobuf
	private String marketCode;
    @Column(name = "ClassCode")
    @Protobuf
	private String classCode;
    @Column(name = "Obj")
    @Protobuf
	private String obj;
    @Column(name = "BS")
    @Protobuf
	private String bs;
    @Column(name = "OpenClose")
    @Protobuf
	private String openClose;
    @Column(name = "HedgeFlag")
    @Protobuf
	private String hedgeFlag;
    @Column(name = "PosID")
    @Protobuf
	private String posID;
    @Column(name = "CustomCode")
    @Protobuf
	private String customCode;
    @Column(name = "CloseType")
    @Protobuf
	private String closeType;
    @Column(name = "BasketID")
    @Protobuf
	private Integer basketID;
    @Column(name = "BasketTatol")
    @Protobuf
	private Integer basketTatol;
    @Column(name = "SeqNum")
    @Protobuf
	private Integer seqNum;
    @Column(name = "ExeTime")
    @Temporal(TemporalType.TIME)
    private Date exeTime;
    //@Transient
	@Protobuf
	private long exeTimeL;
    @Basic(optional = false)
    @Column(name = "ExeSequenceNo")
    @Protobuf
	private int exeSequenceNo;
    @Column(name = "OutsideExeNo")
    @Protobuf
	private String outsideExeNo;
    @Column(name = "ExeQty")
    @Protobuf
	private Integer exeQty;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "ExePrice")
    @Protobuf
	private Float exePrice;
    @Column(name = "Currency")
    @Protobuf
	private String currency;
    @Column(name = "ExeAmount")
    @Protobuf
	private Float exeAmount;
    @Column(name = "CancelQty")
    @Protobuf
	private Integer cancelQty;
    @Column(name = "OrderQty")
    @Protobuf
	private Integer orderQty;
    @Column(name = "WorkingQty")
    @Protobuf
	private Integer workingQty;
    @Column(name = "CompleteQty")
    @Protobuf
	private Integer completeQty;
    @Column(name = "OrderStatus")
    @Protobuf
	private String orderStatus;
    @Column(name = "TotalFare")
    @Protobuf
	private Float totalFare;
    @Column(name = "CommissionFare")
    @Protobuf
	private Float commissionFare;
    @Column(name = "DeliverFare")
    @Protobuf
	private Float deliverFare;
    @Column(name = "Tax")
    @Protobuf
	private Float tax;
    @Column(name = "OtherCost")
    @Protobuf
	private Float otherCost;
    @Column(name = "EsCheckinAmount")
    @Protobuf
	private Double esCheckinAmount;
    @Column(name = "ReMark")
    private String reMark;
    //@Transient
    @Protobuf
	private byte[] reMarkBit;
	
    @Column(name = "InvestID")
    @Protobuf
	private String investID;
    @Column(name = "OwnUserID")
    @Protobuf
	private String ownUserID;
    @Column(name = "AlterUserID")
    @Protobuf
	private String alterUserID;
    @Column(name = "CreateTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
	//@Protobuf
//tprivate long createTimeL;
    @Column(name = "TimeStamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date timeStamp;
	//@Protobuf
	//private long timeStampL;

    public OrderExecuteProgress() {
    }

    public OrderExecuteProgress(Integer orderID) {
        this.orderID = orderID;
    }

    public OrderExecuteProgress(Integer orderID, String accountCode, String dealerUserID, Date submitTime, Date tradeDate, Date dateTime, String orderTypeEmit, int tradeOperate, int exeSequenceNo) {
        this.orderID = orderID;
        this.accountCode = accountCode;
        this.dealerUserID = dealerUserID;
        this.submitTime = submitTime;
		this.submitTimeL = CodeTool.DateToLong(submitTime);
		this.submitTimeL = CodeTool.DateToLong(submitTime);
        this.tradeDate = tradeDate;
		this.tradeDateL = CodeTool.DateToLong(tradeDate);
        this.dateTime = dateTime;
		this.dateTimeL = CodeTool.DateToLong(dateTime);
        this.orderTypeEmit = orderTypeEmit;
        this.tradeOperate = tradeOperate;
        this.exeSequenceNo = exeSequenceNo;
    }

    public Integer getOrderID() {
        return orderID;
    }

    public void setOrderID(Integer orderID) {
        this.orderID = orderID;
    }

    public String getAccountCode() {
        return accountCode;
    }

    public void setAccountCode(String accountCode) {
        this.accountCode = accountCode;
    }

    public String getDealerUserID() {
        return dealerUserID;
    }

    public void setDealerUserID(String dealerUserID) {
        this.dealerUserID = dealerUserID;
    }

    public Date getSubmitTime() {
        return submitTime;
    }

    public void setSubmitTime(Date submitTime) {
        this.submitTime = submitTime;
        this.setSubmitTimeL(CodeTool.DateToLong(submitTime));
		this.setSubmitTimeL(CodeTool.DateToLong(submitTime));
    }

    public Date getTradeDate() {
        return tradeDate;
    }

    public void setTradeDate(Date tradeDate) {
        this.tradeDate = tradeDate;
		this.setTradeDateL(CodeTool.DateToLong(tradeDate));
    }

    public Date getDateTime() {
        return dateTime;
    }

    public void setDateTime(Date dateTime) {
        this.dateTime = dateTime;
		this.setDateTimeL(CodeTool.DateToLong(dateTime));
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public Integer getIp4() {
        return ip4;
    }

    public void setIp4(Integer ip4) {
        this.ip4 = ip4;
    }

    public String getOrderTypeEmit() {
        return orderTypeEmit;
    }

    public void setOrderTypeEmit(String orderTypeEmit) {
        this.orderTypeEmit = orderTypeEmit;
    }

    public int getTradeOperate() {
        return tradeOperate;
    }

    public void setTradeOperate(int tradeOperate) {
        this.tradeOperate = tradeOperate;
    }

    public String getMarketCode() {
        return marketCode;
    }

    public void setMarketCode(String marketCode) {
        this.marketCode = marketCode;
    }

    public String getClassCode() {
        return classCode;
    }

    public void setClassCode(String classCode) {
        this.classCode = classCode;
    }

    public String getObj() {
        return obj;
    }

    public void setObj(String obj) {
        this.obj = obj;
    }

    public String getBs() {
        return bs;
    }

    public void setBs(String bs) {
        this.bs = bs;
    }

    public String getOpenClose() {
        return openClose;
    }

    public void setOpenClose(String openClose) {
        this.openClose = openClose;
    }

    public String getHedgeFlag() {
        return hedgeFlag;
    }

    public void setHedgeFlag(String hedgeFlag) {
        this.hedgeFlag = hedgeFlag;
    }

    public String getPosID() {
        return posID;
    }

    public void setPosID(String posID) {
        this.posID = posID;
    }

    public String getCustomCode() {
        return customCode;
    }

    public void setCustomCode(String customCode) {
        this.customCode = customCode;
    }

    public String getCloseType() {
        return closeType;
    }

    public void setCloseType(String closeType) {
        this.closeType = closeType;
    }

    public Integer getBasketID() {
        return basketID;
    }

    public void setBasketID(Integer basketID) {
        this.basketID = basketID;
    }

    public Integer getBasketTatol() {
        return basketTatol;
    }

    public void setBasketTatol(Integer basketTatol) {
        this.basketTatol = basketTatol;
    }

    public Integer getSeqNum() {
        return seqNum;
    }

    public void setSeqNum(Integer seqNum) {
        this.seqNum = seqNum;
    }

    public Date getExeTime() {
        return exeTime;
    }

    public void setExeTime(Date exeTime) {
        this.exeTime = exeTime;
		this.setExeTimeL(CodeTool.DateToLong(exeTime));
    }

    public int getExeSequenceNo() {
        return exeSequenceNo;
    }

    public void setExeSequenceNo(int exeSequenceNo) {
        this.exeSequenceNo = exeSequenceNo;
    }

    public String getOutsideExeNo() {
        return outsideExeNo;
    }

    public void setOutsideExeNo(String outsideExeNo) {
        this.outsideExeNo = outsideExeNo;
    }

    public Integer getExeQty() {
        return exeQty;
    }

    public void setExeQty(Integer exeQty) {
        this.exeQty = exeQty;
    }

    public Float getExePrice() {
        return exePrice;
    }

    public void setExePrice(Float exePrice) {
        this.exePrice = exePrice;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public Float getExeAmount() {
        return exeAmount;
    }

    public void setExeAmount(Float exeAmount) {
        this.exeAmount = exeAmount;
    }

    public Integer getCancelQty() {
        return cancelQty;
    }

    public void setCancelQty(Integer cancelQty) {
        this.cancelQty = cancelQty;
    }

    public Integer getOrderQty() {
        return orderQty;
    }

    public void setOrderQty(Integer orderQty) {
        this.orderQty = orderQty;
    }

    public Integer getWorkingQty() {
        return workingQty;
    }

    public void setWorkingQty(Integer workingQty) {
        this.workingQty = workingQty;
    }

    public Integer getCompleteQty() {
        return completeQty;
    }

    public void setCompleteQty(Integer completeQty) {
        this.completeQty = completeQty;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Float getTotalFare() {
        return totalFare;
    }

    public void setTotalFare(Float totalFare) {
        this.totalFare = totalFare;
    }

    public Float getCommissionFare() {
        return commissionFare;
    }

    public void setCommissionFare(Float commissionFare) {
        this.commissionFare = commissionFare;
    }

    public Float getDeliverFare() {
        return deliverFare;
    }

    public void setDeliverFare(Float deliverFare) {
        this.deliverFare = deliverFare;
    }

    public Float getTax() {
        return tax;
    }

    public void setTax(Float tax) {
        this.tax = tax;
    }

    public Float getOtherCost() {
        return otherCost;
    }

    public void setOtherCost(Float otherCost) {
        this.otherCost = otherCost;
    }

    public Double getEsCheckinAmount() {
        return esCheckinAmount;
    }

    public void setEsCheckinAmount(Double esCheckinAmount) {
        this.esCheckinAmount = esCheckinAmount;
    }

    public String getReMark() {
        return reMark;
    }

    public void setReMark(String reMark) {
        this.reMark = reMark;
	this.setReMarkBit(CodeTool.StringToBit(reMark));
    }

    public String getInvestID() {
        return investID;
    }

    public void setInvestID(String investID) {
        this.investID = investID;
    }

    public String getOwnUserID() {
        return ownUserID;
    }

    public void setOwnUserID(String ownUserID) {
        this.ownUserID = ownUserID;
    }

    public String getAlterUserID() {
        return alterUserID;
    }

    public void setAlterUserID(String alterUserID) {
        this.alterUserID = alterUserID;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
		//this.createTimeL = CodeTool.DateToLong(createTime);
    }

    public Date getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Date timeStamp) {
        this.timeStamp = timeStamp;
		//this.timeStampL = CodeTool.DateToLong(timeStamp);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (orderID != null ? orderID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrderExecuteProgress)) {
            return false;
        }
        OrderExecuteProgress other = (OrderExecuteProgress) object;
        if ((this.orderID == null && other.orderID != null) || (this.orderID != null && !this.orderID.equals(other.orderID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jili.ubert.dao.db.OrderExecuteProgress[ orderID=" + orderID + " ]";
    }

    public long getSubmitTimeL() {
        return submitTimeL;
    }

    public void setSubmitTimeL(long submitTimeL) {
        this.submitTimeL = submitTimeL;
		this.submitTime = CodeTool.LongToDate(submitTimeL);
    }

    public long getTradeDateL() {
        return tradeDateL;
    }

    public void setTradeDateL(long tradeDateL) {
        this.tradeDateL = tradeDateL;
		this.tradeDate = CodeTool.LongToDate(tradeDateL);
    }

    public long getDateTimeL() {
        return dateTimeL;
    }

    public void setDateTimeL(long dateTimeL) {
        this.dateTimeL = dateTimeL;
		this.dateTime = CodeTool.LongToDate(dateTimeL);
    }

    public long getExeTimeL() {
        return exeTimeL;
    }

    public void setExeTimeL(long exeTimeL) {
        this.exeTimeL = exeTimeL;
		this.exeTime = CodeTool.LongToDate(exeTimeL);
    }

    public byte[] getReMarkBit() {
        return reMarkBit;
    }

    public void setReMarkBit(byte[] reMarkBit) {
        this.reMarkBit = reMarkBit;
		this.reMark = CodeTool.BitToString(reMarkBit);
    }
    
}
